package com.mymvc.controller.json;

import com.mymvc.vo.Product;
import com.mymvc.vo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * ClassName: ProductController
 * Package: com.mymvc.controller.json
 * Description:
 *
 * @Author 刘英杰
 * @Create 2025/2/9 11:35
 * @Version 1.0
 */
@Controller
@RequestMapping("/product")
public class ProductController {

    @GetMapping("/findById.do")
    public @ResponseBody Product findById(int id) {
        return new Product(id,"电视",3999.00);//模拟从数据库查询到数据
    }

    @PostMapping("/update.do")
    public void update(@RequestBody Product product) {
        System.out.println(product);
        int a = 1/0;
    }



}